package edu.hzit.data.service;

import edu.hzit.data.entity.Expense;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ExpenseService {
    /**
     * 插入
     * @param expense
     * @return
     */
    public int insert(Expense expense);
    /**
     * 查询全部
     * @return
     */
    public List<Expense> loadList();
    /**
     * 根据expenseId查询
     * @param expenseId
     * @return
     */
    public Expense selectById(int expenseId);
    /**
     * 根据expenseId删除
     * @param expenseId
     * @return
     */
    public int delete(int expenseId);
    /**
     * 根据id更新
     * @param expense
     * @return
     */
    public int update(Expense expense);
    /**
     * 计算总支出
     * @return
     */
    public int sum(Expense expense);
//    /**
//     * 根据月份计算总支出
//     * @param userId
//     * @param month
//     * @return
//     */
//    public int sumByMonth(@Param("userId") int userId, @Param("month") int month);
}
